package com.buaa.domain;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

/**
 * Title: 机构POJO 
 * Description: 
 * Company: BUAA
 *
 * @author 伟宏 
 * @date 2017年1月24日
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "institution")
@DynamicInsert(true)
@DynamicUpdate(true)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class Institution implements Serializable {

	@Id
	@Column(name = "code", columnDefinition = "bigint(13)")
	private Long code; // 机构编码(1)

	@Column(name = "kind", columnDefinition = "bit(1) default 0")
	private Boolean kind;// 是否加盟(2)

	@Column(name = "name", columnDefinition = "varchar(50) default ''")
	private String name;// 单位名称(3)

	@Column(name = "type", columnDefinition = "tinyint(4) default -1")
	private Byte type;// 机构类型(4)

	@Column(name = "addr", columnDefinition = "varchar(50) default ''")
	private String addr;// 机构地址(5)

	@Column(name = "province", columnDefinition = "char(4) default ''")
	private String province;// 所在省份(6)

	@Column(name = "city", columnDefinition = "varchar(10) default ''")
	private String city;// 所在地市(7)

	@Column(name = "county", columnDefinition = "varchar(20) default ''")
	private String county;// 所在区县(8)

	@Column(name = "street", columnDefinition = "varchar(40) default ''")
	private String street;// 所在街道(9)

	@Column(name = "depart", columnDefinition = "int(11) default -1")
	private Integer depart;// 上级主管部门(10)

	@Column(name = "cor_name", columnDefinition = "varchar(10) default ''")
	private String cor_name;// 法人姓名(11)

	@Column(name = "cor_job", columnDefinition = "varchar(30) default ''")
	private String cor_job;// 法人职务(12)

	@Column(name = "contact_name", columnDefinition = "varchar(20) default ''")
	private String contact_name;// 联系人姓名(13)

	@Column(name = "contact_phone", columnDefinition = "varchar(40) default ''")
	private String contact_phone;// 联系人电话(14)

	@Column(name = "contact_job", columnDefinition = "varchar(30) default ''")
	private String contact_job;// 联系人职务(15)

	@Column(name = "url", columnDefinition = "varchar(80) default ''")
	private String url;// 单位网址(16)

	// @Column(name = "description", columnDefinition = "varchar(8000) default
	// ''")
	// private String description;// 单位简介(17)

	@Column(name = "tech_parent", columnDefinition = "varchar(15) default ''")
	private String tech_parent;// 技术领域（父）(18)

	@Column(name = "tech_child", columnDefinition = "varchar(20) default ''")
	private String tech_child;// 技术领域（子）(19)

	@Column(name = "birth", columnDefinition = "date default '1000-01-01'")
	@Temporal(TemporalType.DATE)
	private Date birth;// 成立时间(20)

	@Column(name = "reg_money", columnDefinition = "int(11) default -1")
	private Integer reg_money;// 注册资金(21)

	@Column(name = "pic", columnDefinition = "varchar(90) default ''")
	private String pic;// 单位图片(22)

	@Column(name = "lng", columnDefinition = "float(9,6) default 0")
	private Float lng;

	@Column(name = "lat", columnDefinition = "float(9,6) default 0")
	private Float lat;

	public Institution() {
	}

	public Institution(Long code, Boolean kind, String name, Byte type, String addr, String province, String city,
			String county, String street, Integer depart, String cor_name, String cor_job, String contact_name,
			String contact_phone, String contact_job, String url, String tech_parent, String tech_child, Date birth,
			Integer reg_money, String pic, Float lng, Float lat) {
		super();
		this.code = code;
		this.kind = kind;
		this.name = name;
		this.type = type;
		this.addr = addr;
		this.province = province;
		this.city = city;
		this.county = county;
		this.street = street;
		this.depart = depart;
		this.cor_name = cor_name;
		this.cor_job = cor_job;
		this.contact_name = contact_name;
		this.contact_phone = contact_phone;
		this.contact_job = contact_job;
		this.url = url;
		this.tech_parent = tech_parent;
		this.tech_child = tech_child;
		this.birth = birth;
		this.reg_money = reg_money;
		this.pic = pic;
		this.lng = lng;
		this.lat = lat;
	}

	public Institution(Long code, String name, Float lng, Float lat) {
		super();
		this.code = code;
		this.name = name;
		this.lng = lng;
		this.lat = lat;
	}

	public Long getCode() {
		return code;
	}

	public void setCode(Long code) {
		this.code = code;
	}

	public Boolean getKind() {
		return kind;
	}

	public void setKind(Boolean kind) {
		this.kind = kind;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Byte getType() {
		return type;
	}

	public void setType(Byte type) {
		this.type = type;
	}

	public String getAddr() {
		return addr;
	}

	public void setAddr(String addr) {
		this.addr = addr;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public String getStreet() {
		return street;
	}

	public void setStreet(String street) {
		this.street = street;
	}

	public Integer getDepart() {
		return depart;
	}

	public void setDepart(Integer depart) {
		this.depart = depart;
	}

	public String getCor_name() {
		return cor_name;
	}

	public void setCor_name(String cor_name) {
		this.cor_name = cor_name;
	}

	public String getCor_job() {
		return cor_job;
	}

	public void setCor_job(String cor_job) {
		this.cor_job = cor_job;
	}

	public String getContact_name() {
		return contact_name;
	}

	public void setContact_name(String contact_name) {
		this.contact_name = contact_name;
	}

	public String getContact_phone() {
		return contact_phone;
	}

	public void setContact_phone(String contact_phone) {
		this.contact_phone = contact_phone;
	}

	public String getContact_job() {
		return contact_job;
	}

	public void setContact_job(String contact_job) {
		this.contact_job = contact_job;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getTech_parent() {
		return tech_parent;
	}

	public void setTech_parent(String tech_parent) {
		this.tech_parent = tech_parent;
	}

	public String getTech_child() {
		return tech_child;
	}

	public void setTech_child(String tech_child) {
		this.tech_child = tech_child;
	}

	public Date getBirth() {
		return birth;
	}

	public void setBirth(Date birth) {
		this.birth = birth;
	}

	public Integer getReg_money() {
		return reg_money;
	}

	public void setReg_money(Integer reg_money) {
		this.reg_money = reg_money;
	}

	public String getPic() {
		return pic;
	}

	public void setPic(String pic) {
		this.pic = pic;
	}

	public Float getLng() {
		return lng;
	}

	public void setLng(Float lng) {
		this.lng = lng;
	}

	public Float getLat() {
		return lat;
	}

	public void setLat(Float lat) {
		this.lat = lat;
	}

	@Override
	public String toString() {
		return "Institution [code=" + code + ", kind=" + kind + ", name=" + name + ", type=" + type + ", addr=" + addr
				+ ", province=" + province + ", city=" + city + ", county=" + county + ", street=" + street
				+ ", depart=" + depart + ", cor_name=" + cor_name + ", cor_job=" + cor_job + ", contact_name="
				+ contact_name + ", contact_phone=" + contact_phone + ", contact_job=" + contact_job + ", url=" + url
				+ ", tech_parent=" + tech_parent + ", tech_child=" + tech_child + ", birth=" + birth + ", reg_money="
				+ reg_money + ", pic=" + pic + ", lng=" + lng + ", lat=" + lat + "]";
	}

}
